.TH std::max_align_t 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::max_align_t \- std::max_align_t

.SH Synopsis
   Defined in header <cstddef>
   typedef /*implementation-defined*/ max_align_t;  \fI(since C++11)\fP

   std::max_align_t is a trivial standard-layout type whose alignment requirement is at
   least as strict (as large) as that of every scalar type.

.SH Notes

   Pointers returned by allocation functions such as std::malloc are suitably aligned
   for any object, which means they are aligned at least as strictly as
   std::max_align_t.

.SH Example


// Run this code

 #include <cstddef>
 #include <iostream>

 int main()
 {
     std::cout << alignof(std::max_align_t) << '\\n';
 }

.SH Possible output:

 16

.SH References

     * C++23 standard (ISO/IEC 14882:2023):

     * 17.2.4 Sizes, alignments, and offsets [support.types.layout] (p: 504-505)
     * C++20 standard (ISO/IEC 14882:2020):

     * 17.2.4 Sizes, alignments, and offsets [support.types.layout] (p: 507-508)
     * C++17 standard (ISO/IEC 14882:2017):

     * 21.2.4 Sizes, alignments, and offsets [support.types.layout] (p: 479)
     * C++14 standard (ISO/IEC 14882:2014):

     * 18.2 Types [support.types] (p: 443-444)
     * C++11 standard (ISO/IEC 14882:2011):

     * 18.2 Types [support.types] (p: 454-455)

.SH See also

   alignof operator\fI(C++11)\fP queries alignment requirements of a type
   alignment_of            obtains the type's alignment requirements
   \fI(C++11)\fP                 \fI(class template)\fP
   is_scalar               checks if a type is a scalar type
   \fI(C++11)\fP                 \fI(class template)\fP
   C documentation for
   max_align_t
